/****** Object:  Stored Procedure [dbo].spCongTyInsert Script Date: 6/12/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spCongTyInsert]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spCongTyInsert]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		21/06/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spCongTyInsert]
(
	@TenCTy nvarchar(80),
	@DiaChi nvarchar(80),
	@SoDT nvarchar(15),
	@SoFax nvarchar(15),
	@MaSoThue nvarchar(15),
	@Email nvarchar(30),
	@Website nvarchar(35),
	@NguoiLienHe nvarchar(35),
	@Logo nvarchar(15),
	@GhiChu nvarchar(200),
	@MaCTy int output
)
WITH ENCRYPTION

AS

SET NOCOUNT ON

INSERT INTO [tbl_CongTy]
(
	[TenCTy],
	[DiaChi],
	[SoDT],
	[SoFax],
	[MaSoThue],
	[Email],
	[Website],
	[NguoiLienHe],
	[Logo],
	[GhiChu]
)
VALUES
(
	@TenCTy,
	@DiaChi,
	@SoDT,
	@SoFax,
	@MaSoThue,
	@Email,
	@Website,
	@NguoiLienHe,
	@Logo,
	@GhiChu
)

SELECT @MaCTy = SCOPE_IDENTITY()
--SELECT @Id = @@IDENTITY
GO

--GRANT EXECUTE ON [dbo].[spCongTyInsert] TO [sa]
--GO
